export const SafePromiseAll = (promises: Promise<any>[]) => {
  return Promise.all(
    promises.map(promise =>
      promise
        .then(res => ({ ...res, ok: true }))
        .catch(err => ({ ok: false, err }))
    )
  );
};
